package ltd.dujiabao.reserver.constant;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import lombok.extern.slf4j.Slf4j;

/**
 * @author : DuJiabao
 * @Project : reserver
 * @Time : 2021/11/5 22:06
 * @Desc :
 */
@Component
@Slf4j
public class Constant {
    @Autowired
    private Environment env;

    public static String secretId;
    public static String secretKey;
    public static String bucketName;
    public static String regionName;
    public static String ocrEndpoint;

    @PostConstruct
    public void init() {
        secretId = env.getProperty("reserver.tencent.secretId");
        secretKey = env.getProperty("reserver.tencent.secretKey");
        bucketName = env.getProperty("reserver.tencent.cos.bucketName");
        regionName = env.getProperty("reserver.tencent.cos.regionName");
        ocrEndpoint = env.getProperty("reserver.tencent.ocr.endpoint");
        log.info("Success to initial the value in Constant");
    }
}
